package com.seleniti.enpareja.android.ui.view;

import org.ioc.commons.ui.features.Info;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.seleniti.enpareja.android.R;
import com.seleniti.enpareja.android.ui.widget.InfoInlineWidget;
import com.seleniti.enpareja.android.ui.widget.UserFormWidget;
import com.seleniti.enpareja.controller.ui.view.SignUpView;
import com.seleniti.enpareja.controller.ui.view.SignUpView.Action;
import com.seleniti.enpareja.controller.ui.view.SignUpView.Event;
import com.seleniti.enpareja.controller.ui.view.SignUpView.Operation;
import com.seleniti.enpareja.controller.ui.view.SignUpView.Presenter;
import com.seleniti.enpareja.controller.ui.view.SignUpViewPresenter;
import com.seleniti.enpareja.controller.ui.widget.UserForm;

public class SignUpViewWidget extends EnParejaBaseView<Event, Operation, Action, Presenter> implements
		SignUpView {


	private UserFormWidget userForm;
	private InfoInlineWidget extraInfo;

	public SignUpViewWidget() {
		super(false);
	}

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		this.setRetainInstance(true);
	}
	
	@Override
	public void onActivityCreated(Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);
		this.presenter = new SignUpViewPresenter(this, eventbus, operationManager, actionController);

	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		View view = inflater.inflate(R.layout.signup_view, container, false);

		this.userForm = (UserFormWidget) view.findViewById(R.id.userForm);
		this.extraInfo = (InfoInlineWidget) view.findViewById(R.id.extraInfo);

		return view;
	}

	@Override
	public UserForm userForm() {
		return this.userForm;
	}

	@Override
	public Info extraInfo() {
		return this.extraInfo;
	}

}
